package com.biaobiaoqi.scoreanalysis.security;

public class PasswordEncryption  {
	EncryptStrategy strategy;
	/**
	 * you can change different strategy here!
	 */
	private static final PasswordEncryption INSTANCE = new PasswordEncryption(
			new StandardMD5EncryptStrategy());
	private PasswordEncryption() {
		throw new IllegalAccessError();
	}
	
	private PasswordEncryption(EncryptStrategy strategy) {
		this.strategy = strategy;
	}
	
	public static PasswordEncryption getInstance() {
		return INSTANCE;
	}

	public String encryptPassword(String password) {
		return strategy.encryptPassword(password);
	}

}
